CheckReservoirInDomain Subroutine

private subroutine CheckReservoirInDomain(list, grid)

check and delete reservoirs outside of the computational domain.

Arguments

Type IntentOptional Attributes Name
type(Reservoir), intent(inout), POINTER :: list

header of the list

type(grid_integer), intent(in) :: grid

Variables

Type Visibility Attributes Name Initial
type(Reservoir), public, POINTER :: current
type(Reservoir), public, POINTER :: next

Source Code

SUBROUTINE CheckReservoirInDomain &
!
(list, grid)

IMPLICIT NONE

!Arguments with intent(in):
TYPE (grid_integer), INTENT(IN) :: grid
!Arguments with intent(inout):
TYPE(Reservoir), POINTER, INTENT (INOUT) :: list  !! header of the list

!local declarations
TYPE(Reservoir), POINTER :: current, next  

!---------------------------end of declarations--------------------------------

current => list

DO WHILE ( ASSOCIATED (current) )
    IF ( .NOT. IsPointInside ( current % xyz, mask, .TRUE. ) ) THEN
        next  => current % next 
        CALL DeleteReservoir (list, current)
        nReservoirs = nReservoirs - 1
    ELSE
       next  => current % next  
    END IF
        
    current => next 
END DO


RETURN
END SUBROUTINE CheckReservoirInDomain